from  django.views import View
from  django.http import HttpResponse,JsonResponse
from  django.shortcuts import render
from  django.db import connection
import time
import hashlib
from ..lib import redisPool
from ..lib import checkToken


class AddGoods(View):

    def get(self, request):
        return HttpResponse('请使用Post调用该接口!')

    def post(self, request):

        checktoken= checkToken.CheckToken()
        token = request.POST.get('token')
        if token ==False:
            return JsonResponse({"code":400,'result': "您还未登陆!"})

        return  JsonResponse({'result':checktoken.islogin(token)})




